package cn.huihuo.weibo.controller;

import cn.huihuo.weibo.bean.comment.ChooseResult;
import cn.huihuo.weibo.service.ChooseChannelService;
import cn.jfinalbbs.common.BaseController;
import cn.jfinalbbs.common.Constants;
import cn.jfinalbbs.user.User;

/**
 * Created by zhengjunbo on 2015/10/27.
 */
public class ChannelController extends BaseController {

    /**
     * 选择通道，逻辑
     */

    public void chooseChannel(){

        Integer ugcId = getParaToInt("ugcId");
        String ugcType = getPara("ugcType");
        Integer chooseChannel = getParaToInt("chooseChannel");

        User user = getSessionAttr(Constants.USER_SESSION);
        if(user==null){
            error("请登录后添加！");
            return;
        }

        ChooseResult chooseResult = ChooseChannelService.service.findChooseResult(ugcId, user.getStr("id"), chooseChannel);
        success(chooseResult);

    }
}
